import os
from enum import unique

from myapp.const.base import TEnum, SharedMntDir

# Message key for indicating that a dataset is currently importing.
MsgKeyDatasetImporting = "dataset_importing"
# Message key for indicating that an evaluation dataset has been created.
MsgKeyEvalDatasetCreated = "eval_dataset_created"
# Prefix for the original path of temporary dataset files.
OriginPathPrefix = "__dataset/tmp/"
# The absolute directory path for temporary dataset files, constructed using SharedMntDir.
DatasetTmpDir = os.path.join(SharedMntDir, OriginPathPrefix)
# Prefix for the path where merged dataset files are stored.
MergePathPrefix = "__dataset/merge/"


# Defines an enumeration for various dataset import statuses.
@unique
class EnumDatasetStatus(TEnum):
    """
    数据集导入状态
    """
    # Indicates that the dataset is being uploaded but not yet imported.
    uploading = "uploading"  # 未导入
    # Indicates that the dataset is currently being processed for import.
    processing = "processing"  # 导入中
    # Indicates that the dataset import has successfully completed.
    succeed = "succeed"  # 导入完成
    # Indicates that the dataset import has failed.
    failed = "failed"  # 失败


# Defines an enumeration for various dataset publishing statuses.
@unique
class EnumDatasetPublishStatus(TEnum):
    """
    数据集发布状态
    """
    # Indicates that the dataset is currently being published.
    publishing = "publishing"  # 发布中
    # Indicates that the dataset has not yet been published.
    unpublished = "unpublished"  # 未发布
    # Indicates that the dataset has been successfully published.
    published = "published"  # published
    # Indicates that the dataset publishing has failed.
    failed = "failed"  # 发布失败


# Defines an enumeration for different sources of datasets.
@unique
class EnumDatasetSource(TEnum):
    # Indicates that the dataset is internal or built-in.
    internal = "internal"  # 内置
    # Indicates that the dataset was uploaded by a user.
    upload = "upload"  # 上传
    # Indicates that the dataset was generated via data flowback.
    flowback = "flowback"  # 数据回流


# Defines an enumeration for various dataset data types.
@unique
class EnumDatasetDataType(TEnum):
    """
    数据类型
    """
    # Represents text data.
    txt = "txt"  # 文本
    # Represents image data.
    image = "image"  # 图像
    # Represents audio data.
    audio = "audio"  # 语音
    # Represents multimodal data (e.g., text and image).
    multiple = "multiple"  # 多模态
    # Represents other or unspecified data types.
    other = "other"  # 其他


# Defines an enumeration for various dataset label types or uses.
@unique
class EnumDatasetLabelType(TEnum):
    """
    数据用途
    """
    # Label type for text generation pre-training.
    text_generation_pretrain = "Text Generation Pretrain"  # 文本生成-预训练
    # Label type for text generation fine-tuning (multiple rounds of question answering).
    text_generation_sft = "Multiple Rounds of Text Question Answer"  # 文本生成-微调
    # Label type for visual question answering (multimodal, multiple rounds).
    vqa = "Multiple Rounds of Visual Question Answer"  # 多模态-图文问答